# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Konstantin Gizdov <arch@kge.pw>
# Contributor: Alad Wenter <alad@archlinux.org>
# Contributor: Thorsten Töpper <atsutane-tu@freethoughts.de>
# Contributor: J0k3r <moebius282 e4a t gmail D0_T com>
# Contributor: Alois Nespor <alois.nespor@gmail.com>
# Contributor: JerichoKru   <jerichokru(AT)hotmail.com>

pkgname=pragha
pkgver=1.3.4
pkgrel=5
pkgdesc='Lightweight GTK music player and manager'
arch=('loong64' 'x86_64')
url='https://pragha-music-player.github.io/'
license=('GPL3')
depends=('cairo' 'gdk-pixbuf2' 'glib2' 'gstreamer' 'gst-plugins-base' 'gst-plugins-base-libs'
         'gst-plugins-good' 'gtk3' 'hicolor-icon-theme' 'libgudev' 'libpeas' 'pango' 'sqlite'
         'taglib' 'totem-pl-parser')
optdepends=('glyr: Get Artist info, Lyrics and Album arts plugin'
            'grilo: DLNA Renderer plugin'
            'gst-libav: Extra media codecs'
            'gst-plugins-bad: Extra media codecs'
            'gst-plugins-ugly: Extra media codecs'
            'libcddb: Play cdrom plugin'
            'libcdio-paranoia: Play cdrom plugin'
            'libclastfm: Last.fm plugin'
            'libkeybinder3: Global Hotkeys plugin'
            'libmtp: MTP Devices plugin'
            'libnotify: Notification plugin'
            'libsoup: AcoustID and Get radios plugin')
makedepends=('intltool' 'glyr' 'gobject-introspection' 'grilo' 'libcddb' 'libcdio-paranoia'
             'libclastfm' 'libkeybinder3' 
             'libmtp' 'libnotify' 'libsoup')
replaces=('dissonance')
source=("https://github.com/pragha-music-player/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.bz2")
sha256sums=('e54e6acdc11e6f19c691c6e069fa9d54934c37b0f4b78cd5e835ce9512866ba6')

prepare() {
  cd $pkgname-$pkgver
  sed -i 's|(datadir)/appdata|(datadir)/metainfo|' data/Makefile.{am,in}
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}
